Skip to content

Inject RN bundleId with ASM#2199

Merged
priettt merged 1 commit intomainfrom
priettt/injectBundleIdWithASM
May 13, 2025
Merged

Inject RN bundleId with ASM#2199
priettt merged 1 commit intomainfrom
priettt/injectBundleIdWithASM

Conversation

@priettt
Copy link
Copy Markdown
Contributor

@priettt priettt commented May 8, 2025

Goal

Similar to what we did with NDK symbols, inject the React BundleID with ASM. This allows us to remove resource injection altogether and access the bundle ID through the project instrumented config.

Testing

Modified integration test to verify injection

@priettt priettt requested a review from a team as a code owner May 8, 2025 19:21
@priettt priettt force-pushed the priettt/injectBundleIdWithASM branch 2 times, most recently from bccae37 to 2423152 Compare May 8, 2025 19:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 8, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@priettt priettt force-pushed the priettt/injectBundleIdWithASM branch 2 times, most recently from cb78816 to 06fa5d9 Compare May 8, 2025 19:49
@codecov
Copy link
Copy Markdown

codecov bot commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.63%. Comparing base (f396ec1) to head (e01ee51).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2199      +/-   ##
==========================================
- Coverage   85.63%   85.63%   -0.01%     
==========================================
  Files         465      465              
  Lines       10389    10381       -8     
  Branches     1522     1522              
==========================================
- Hits         8897     8890       -7     
- Misses        835      836       +1     
+ Partials      657      655       -2     
Files with missing lines Coverage Δ
...racesdk/internal/buildinfo/BuildInfoServiceImpl.kt 100.00% <100.00%> (+16.66%) ⬆️
...id/embracesdk/internal/injection/CoreModuleImpl.kt 94.11% <100.00%> (-5.89%) ⬇️
...ternal/config/instrumented/schema/ProjectConfig.kt 83.33% <100.00%> (+3.33%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@priettt priettt force-pushed the priettt/injectBundleIdWithASM branch 2 times, most recently from e8397c2 to 4b01062 Compare May 9, 2025 13:54
import io.embrace.android.gradle.plugin.instrumentation.config.model.VariantConfig

fun createProjectConfigInstrumentation(cfg: VariantConfig) = modelSdkConfigClass {
fun createProjectConfigInstrumentation(cfg: VariantConfig, reactNativeBundleId: String?) = modelSdkConfigClass {
Copy link
Copy Markdown
Contributor

@bidetofevil bidetofevil May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this is parallel to the config object rather than part of it?

It's not part of the Embrace config that we derive from the config file, but it certain seems parallel to things like buildId

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's mostly because we can't access it at the same time, but it'd be nice to aggregate the parameters in a class in the future, especially in createClassVisitor.

Copy link
Copy Markdown
Contributor

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One question about why the bundleId doesn't live in the same object as the buildId

@priettt priettt force-pushed the priettt/injectBundleIdWithASM branch from 4b01062 to e01ee51 Compare May 13, 2025 16:07
@priettt priettt merged commit afc9b33 into main May 13, 2025
11 checks passed
@priettt priettt deleted the priettt/injectBundleIdWithASM branch May 13, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants